POV-Ray : Newsgroups : povray.newusers : camera angle : camera angle Server Time
30 Jul 2024 20:25:15 EDT (-0400)
  camera angle  
From: Bill Hails
Date: 12 Oct 2003 11:01:19
Message: <3f896cbf@news.povray.org>
hmm, 2 questions in a row, at least you know I'm keen :-)

From the description of the camera angle in section 6.4.1,
and referring to the figure in that section.

I thought it should be easy to determine a line parallel
to the "right" vector, but passing through the look_at point.

I should then be able to interpolate the dotted lines delimiting
the angle to this line, and placing an object at each of these
points they should appear precisely at the edges of the image.

Here's my code. I can't see what's wrong with it, but the
spheres are definately not at the edges of the screen.

#include "math.inc"
#include "colors.inc"

#local Location = <0, 0, -10>;
#local LookAt = <0, 0, 0>;
#local Angle = 50;

#local Direction = LookAt - Location;
#local Distance = vlength(Direction);
#local PerpDirection = vcross(Direction, y);
#local PerpDistance = sind(Angle/2) * Distance;
#local MaxLeft = LookAt + PerpDistance * vnormalize(PerpDirection);
#local MaxRight = LookAt - PerpDistance * vnormalize(PerpDirection);

camera {
    location Location
    angle Angle
    look_at LookAt
}

sphere { MaxLeft, 0.2 pigment { Red } }
sphere { LookAt, 0.2 pigment { Green } }
sphere { MaxRight, 0.2 pigment { Blue } }

light_source { <1, 10, -10> White }

-- 
Bill Hails


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.